package com.ec.edu.application.hello;

import com.ec.edu.application.hello.pojo.vo.HostInfoVo;
import com.ec.edu.application.hello.pojo.vo.MemberVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/rest/api/hello")
public class HelloRestApi {

    @GetMapping("/share/{name}")
    public MemberVo share(@PathVariable(name = "name") String name) {
        MemberVo memberVo = new MemberVo();
        memberVo.setMemberName(name);
        return memberVo;
    }

    @GetMapping("/device/{deviceId}")
    public HostInfoVo device(String deviceId) {
        return new HostInfoVo();
    }

    @GetMapping("/count/{count}")
    public Long share(@PathVariable(name = "count") Long count) {
        return ++count;
    }
}
